import { createStore } from "vuex";
import authorFiltrate from "@/store/authorFiltrate";
import popup from "@/store/popup";
import petFiltrate from "@/store/petFiltrate";
import area from "@/store/area";
import user from "@/store/user";
import publishPet from "@/store/publishPet";
import search from "@/store/search";
import createPersistedstate from "vuex-persistedstate";

export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules: {
    authorFiltrate,
    petFiltrate,
    popup,
    area,
    user,
    publishPet,
    search,
  },
  plugins: [
    createPersistedstate({
      // 数据存储在localStorage时的key
      key: "cly",
      // 指定将哪些模块中的数据同步到本地
      paths: ["user"],
    }),
  ],
});
